#ifndef LOGINBROWSER_H
#define LOGINBROWSER_H

#include <QWebView>

/*
 * LoginBrowser is used for sending user to the 
 * Approve Application screen of twitter.
 *
 * This should be usable even if logging in
 * was done from other site with or without OAuth
 */

class LoginBrowser : public QWebView {
    Q_OBJECT

    public:
        LoginBrowser( QWidget * parent = 0 );

    public slots:
        void loadLogin();

    signals:
        void loginLoadStarted(); // started loading login page
        void loginLoadFinished(); // login page loaded
        void authenticationStarted(); // user authentication has started (left login screen)
        void authenticationProgress( int ); // progress of user authentication
        void authenticationFinished(); // authentication finished, cookies should have login information

    private slots:
        // handle signals of QWebView to provide login signals
        void handleUrlChanged( QUrl url );
        void handleProgress( int );
        void handleLoadFinished();

    private:
        int maxAuthProgress; // fix bug with progress bar going back (check if this is really needed)
};

#endif
